<div class='left'>
  <div class="title">List of the translators</div>
  <div class="mb">
    <div class="left"><button ng-click="edit('')">Add a new translator</button></div>
    <div class="left"><button ng-click="saveAll()" ng-disabled="noneModified()">Save translators</button></div>
    <div class="right">Filter: <input type="text" ng-model="search" class="search-query" 
                                                  placeholder="Filter" /></div>
  </div>
  <table>
    <tr>
      <th>Email address</th>
      <th>Name</th>
      <th>Languages</th>
      <th><img src="icons/undo.svg" width=16 height=16 title='Undo changes'></th>
      <th><img src="icons/trash.svg" width=16 height=16 title='Delete'></th>
    </tr>
    <tr ng-repeat="t in translators | filter: t_filter(search)"
        ng-click="edit(t.email)" ng-class="getRowClass(t)">
      <td>{{t.email}}</td>
      <td>{{t.name}}</td>
      <td>{{getLangStrings(t.langs)}}</td>
      <div ng-if="!canGoBack()" class="prev no-bg-image"></div>
     <div ng-if="canGoBack()" ng-click="showPreviousEvents()" class="prev">{{phrases.Frueher}}</div>
      <td ng-if="t.is_modified && !t.is_new" ng-click="unedit(t.email); $event.stopPropagation()">
        <img src="icons/undo.svg" width=16 height=16 title='Undo changes'>
      </td>
      <td ng-if="!t.is_modified || t.is_new"></td>
      <td class="red-hover" ng-click="remove(t.email); $event.stopPropagation()">
        <img src="icons/trash.svg" width=16 height=16 title='Delete'>
      </td>
    </tr>
  </table>
</div>
<div id="edit-popup" class="popup-screen">
  <div class="popup-head">Edit translator</div>
  <div class="popup-body">
    <form name="edit-form" ng-submit="save()">
      <p>Name: <input type="text" ng-model="translator.name" required /></p>
      <p>E-mail: <input type="email" ng-model="translator.email" required /></p>
      <p>Add or remove language: <select id='select' multiple=true style='height: 100%;' ng-model="translator.langs"
                 ng-options="l.code as l.germanName for l in lang_options">
      </select></p><p>(hold ctrl to select multiple options)</p>
      <button ng-click="cancel()">Cancel</button>
      <input type="submit" ng-disabled="edit-form.$invalid" value="Save" />
    </form>
  </div>
</div>

